﻿<div class="contentTitleDark">
{$location}
</div>

{if $thread.longDescription}
<div class="contentTitleLightMain">{$thread.name}</div>
<div class="content">{$thread.longDescription}</div>
{/if}

{if count($threads) > 0}
	{if $k > 0}</table></div>{/if}
	<div class="content">
	<table cellspacing="1" cellpadding="1" border="0" style="width:100%;background-color:;">
		<tr style="background-color:#FDECEA; height: 25px;">
			<td width="32">&nbsp;</td>
			<td class="black s11 b" width="300">Nimi</td>
			<td class="black s11 b" width="80" style="text-align:center">Vaatamisi</td>
			<td class="black s11 b" width="80" style="text-align:center">Postitusi</td>
			<td class="black s11 b" width="*" style="text-align:center">Viimane postitus</td>
			<td class="black s11 b" width="*" style="text-align:center">Viimane postitaja</td>
		</tr>
		{foreach item=i from=$threads}
		<tr style="background-color:{cycle values='#FFFFFF,#F3F3F3'};">
			<td> <img src="{$mediaUrl}Foorum/thread.gif"></td>
			<td> <a href="{$pageUrl}Forum/thread/{$i.id}" class="red s11 b">{$i.name}</a><br /> {$i.description} </td>
			<td class="lightGrey s10" style="text-align:center">{$i.views}</td>
			<td class="lightGrey s10" style="text-align:center">{$i.nrOfPosts}</td>
			<td class="lightGrey s10" style="text-align:center">
			{$i.lastPostTime|date_format:"%d-%m-%Y %H:%M"}<br />
			<a href="{$thread.lastTopicLink}" class="red s10 b">{$i.lastTopicHeadline|truncate:34}</a>
			</td>
			<td class="red s10 b" style="text-align:center">{$i.lastPostNickname}</td>
		</tr>
		{/foreach}
	</table>
	</div>
{/if}


	<div class="contentTitleLightMain">
		{if $thread.allowTopics != 2}
		<div class="redButton"><a href="{$pageUrl}Forum/managePost/{$thread.id}/addTopic/"> Alusta uut teemat </a></div>
		<div class="redButton"><a href="{$pageUrl}Forum/thread/{$thread.id}/&allRead=1"> Märgi kõik loetuks</a></div>
		{/if}
		Teemad
	</div>
{if count($topics) > 0}
	{if count($pages) > 0}
		<div class="content">
		<div class="pageNumbers">
		{if $prevLink}<a href="{$prevLink}" style="width:50px">Eelmised</a>{/if}
		{foreach item=i from=$pages}
			<a href="{$i.link}"  style="{if $i.selected}font-weight:bold{/if} ">{$i.name}</a>
		{/foreach}
		{if $nextLink}<a href="{$nextLink}" style="width:57px">Järgmised</a>{/if}
		</div>
		</div>
	{/if}


	<div class="content">
		<table width="100%" border="0" cellspacing="1" cellpadding="1" style="background-color:#E6E6E6">
			<tr style="background-color:#FDECEA; height: 30px;">
				<td class="black s11 b"  width="32">&nbsp;</td>
				<td class="black s11 b"  width="320">Teema</td>
				<td class="black s11 b"  width="70" style="text-align:center">Alustas</td>
				<td class="black s11 b"  width="70" style="text-align:center">Postitusi</td>
				<td class="black s11 b"  width="70" style="text-align:center">Vaatamisi</td>
				<td class="black s11 b"  width="100" style="text-align:center">Viimane postitus</td>
				<td class="black s11 b"  width="*" style="text-align:center">Viimane postitaja</td>
			</tr>
			<tbody>
			{foreach item=i from=$topics}
			<tr style="background-color: {cycle values='#FFFFFF,#F3F3F3'}" >
				<td style="text-align:center;">
					<a href="{$pageUrl}Forum/topic/{$i.id}&lk={$i.lk}" class="red s11 b">
					{if $i.icon}
						<img src="{$uploadUrl}ForumTopicIcons/{$i.icon}" align="left" border="0" style="margin-right:2px;"/>
					{else}
						<div style="width:80px; height:42px; float:left; padding-top:8px; "><img src="{$mediaUrl}Foorum/topic.gif"></div>
					{/if}
					</a>
				</td>
				<td><a href="{$pageUrl}Forum/topic/{$i.id}&lk={$i.lk}" class="red s11 b">{$i.title|truncate:53}</a> {if $i.new} Uus! {/if}</td>
				<td class="lightGrey s10" style="text-align:center">{$i.starterUsername}</td>
				<td class="lightGrey s10" style="text-align:center">{$i.nrOfPosts}</td>
				<td class="lightGrey s10" style="text-align:center">{$i.views}</td>
				<td class="lightGrey s10" style="text-align:center">{$i.lastPostTime|date_format:"%d-%m-%Y %H:%M"}</td>
				<td class="lightGrey s10" style="text-align:center">{$i.nickname}</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
	</div>
	
	{if count($pages) > 0}
		<div class="content">
		<div class="pageNumbers">
		{if $prevLink}<a href="{$prevLink}" style="width:50px">Eelmised</a>{/if}
		{foreach item=i from=$pages}
			<a href="{$i.link}"  style="{if $i.selected}font-weight:bold{/if} ">{$i.name}</a>
		{/foreach}
		{if $nextLink}<a href="{$nextLink}" style="width:57px">Järgmised</a>{/if}
		</div>
		</div>
	{/if}
	{if $thread.allowTopics != 2}
		<div class="contentTitleLightMain">
			<div class="redButton" style="float:left;"><a href="{$pageUrl}Forum/managePost/{$thread.id}/addTopic/"> Alusta uut teemat </a></div>
		</div>
	{/if}

{/if}